import request from '@/utils/request'

/**
 * 发布招聘计划书
 * @returns {AxiosPromise}
 * @param data
 */
export function releasePlan(data) {
  return request({
    url: '/artisan/releasePlan',
    method: 'post',
    data
  })
}

/**
 * 查出所有部门
 * @returns {AxiosPromise}
 */
export function getAllDepartment() {
  return request({
    url: '/artisan/getAllDepartment',
    method: 'get'
  })
}

/**
 * 查出所有招聘计划书
 * @returns {AxiosPromise}
 */
export function getAllRecruit(page) {
  return request({
    url: '/artisan/getAllRecruit',
    method: 'get',
    params: { 'page': page }
  })
}

/**
 * 技术人员自己发布招聘计划书
 * @returns {AxiosPromise}
 */
export function getReleaseRecruitByUserId() {
  return request({
    url: '/artisan/getReleaseRecruitByUserId',
    method: 'get'
  })
}

/**
 * 根据ID查出招聘计划书
 * @returns {AxiosPromise}
 */
export function getRecruitInfoById(recruitId) {
  return request({
    url: '/artisan/getRecruitInfoById',
    method: 'get',
    params: { 'recruitId': recruitId }
  })
}

/**
 * 审核通过
 * @returns {AxiosPromise}
 */
export function checkOK(params) {
  return request({
    url: '/artisan/checkOK',
    method: 'post',
    params: params
  })
}

/**
 * 审核不通过
 * @returns {AxiosPromise}
 */
export function checkNO(params) {
  return request({
    url: '/artisan/checkNO',
    method: 'post',
    params: { 'recruitId': params }
  })
}

/**
 * 查看应聘学生
 * @param params
 * @returns {AxiosPromise}
 */
export function getListApplyByRecruitId() {
  return request({
    url: '/artisan/getApplyStudentByRecruitId',
    method: 'get'
  })
}

/**
 * 审核学生申请书
 * @returns {AxiosPromise}
 */
export function checkStudentApply(applyId, email, status) {
  return request({
    url: '/artisan/checkStudentApply',
    method: 'get',
    params: { 'applyId': applyId, 'email': email, 'status': status }
  })
}

/**
 * 已经审核过的学生列表
 * @returns {AxiosPromise}
 */
export function alreadyCheckStudentList() {
  return request({
    url: '/artisan/alreadyCheckStudentList',
    method: 'get'
  })
}

/**
 * 发布面试结果
 */
export function releaseInterviewResult(params) {
  return request({
    url: '/artisan/releaseInterviewResult',
    method: 'post',
    params
  })
}
